import request from '../utils/request';


export interface TracksData {
    tracksForAudioPlay: TracksForAudioPlay[];
}


export const DEFAULT_ALBUM_PAGE_NUM = 1;
export const DEFAULT_ALBUM_PAGE_SIZE = 30;

interface TracksForAudioPlay {
    index: number;
    trackId: number;
    trackName: string;
    trackUrl: string;
    trackCoverPath: string;
    albumId: number;
    albumName: string;
    albumUrl: string;
    anchorId: number;
    canPlay: boolean;
    isBaiduMusic: boolean;
    isPaid: boolean;
    duration: number;
    src?: string;
    hasBuy: boolean;
    albumIsSample: boolean;
    sampleDuration: number;
    updateTime: string;
    createTime: string;
    isLike: boolean;
    isCopyright: boolean;
    firstPlayStatus: boolean;
}

export const getTracks = (trackIds: number[]) => {
    return request.get('/play/tracks', {
        params: { trackIds: trackIds.join(',') },
    });
};
